<?=isset($header) ? $header : ''?>
<div id="content">
	<div class="form_style">
		<div class="title">
			<h5>用戶編輯</h5>
		</div>
		<form method="post" action="<?=site_url('/user/edit_submit')?>" id="userinfo">
		<div>
			<table border="1">
			  <tbody><tr>
			    <th width="80">用戶ID：</th>
			    <td>
			      <?=$users->user?>
			    </td>
			  </tr>
			   <tr>
			    <th>用戶姓名：</td>
			    <td><input type="text"  name="name" value="<?=$users->name?>" >

			    </th>
			  </tr>
			  <tr>
			    <th>用戶密碼：</th>
			    <td><input type="password" id="password" name="password">(注：用戶密碼為登錄密碼)</td>			    
			  </tr>


			  <tr>
			    <th>E-Mail：</th>
			    <td><input type="text" id="email" name="email" value="<?=$users->email?>" ></td>			    
			  </tr>

			  <tr>
			    <th>手機：</th>
			    <td><input type="text" id="phone" name="phone" value="<?=$users->phone?>" ></td>			    
			  </tr>

			  <tr>
			    <th>所屬部門：</th>
			    <td>
			    	<select name="department_id" id="department_id">
					<? foreach($department as $key=>$val){?>
			    		<option value="<?=$val->department_id?>" <? if($val->department_id==$users->department_id) echo "selected";?>><?=$val->department_name?></option>
					<?
					}
					?>
					</select>
			    </td>
			  </tr>
			  <tr>
			    <th>權限：</th>
			    <td>
			    	<select name="role_id" id="role_id">
			    	<? foreach($role as $key=>$val){?>
			    		<option value="<?=$val->role_id?>" <? if($val->role_id==$users->role_id) echo "selected";?>><?=$val->role_name?></option>
					<?
					}
					?>
					</select>
			    
			    (注：用戶擁有的權限)</td>
			             
			  </tr>
			 
			  <tr>
			    <td></td>
			    <td class="last_save">
					<input type="hidden" id="users_id" name="users_id" value="<?=$users->users_id?>">
					<input type="submit" onclick="return checkadduser();" value="確定" class="input_background">
			   		<input type="reset" value="重置" class="input_background"></td>
			  </tr>
			</tbody></table>
		</div>
		</form>
	</div>
</div>
<?=isset($footer) ? $footer : ''?>